#
#
#

import pykd

class test:

    """base class for all tests"""


    def __init__( self ):
        self.treatFilter = ()
        self.treatFound = []
        self.warningList = []


    def analyze( self ):
        pass


# TODO: works with configs
    def loadConfig( self ):
        pass

   
    def saveConfig( self ):
        pass


#TODO: returns analyze time
               
    def reportTreat( self, sign, text ):
        if sign not in self.treatFilter: self.treatFound.append( ( sign, text ) )
        
    def reportWarning(self, text):       
        self.warningList.append( text )
    
    def printTreats( self ):

         pykd.dprint( self.__class__.__name__ + ": ")
         
         if len(self.treatFound) > 0:
            pykd.dprintln("")
            for report in self.treatFound: 
                pykd.dprintln( "hash: %#x  %s" % report )
         else:
           pykd.dprintln( "no threat" )
           
    def printWarnings( self ):
         
         pykd.dprint( self.__class__.__name__ + ": ")
         
         if len(self.warningList) > 0:
            pykd.dprintln("")
            for warning in self.warningList: 
                pykd.dprintln( warning )
         else:
           pykd.dprintln( "no warnings" )         
         
         
                    
